<?xml version="1.0" encoding="UTF-8"?>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="./css/template.css" />
        <link type="text/css" rel="stylesheet" href="./css/SyntaxHighlighter.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Eclipse UML</title>
        <script language="javascript" src="./js/shInit.js" />
        <script language="javascript" src="./js/shCore.js" />
        <script language="javascript" src="./js/shBrushCpp.js" />
        <script language="javascript" src="./js/shBrushCSharp.js" />
        <script language="javascript" src="./js/shBrushCss.js" />
        <script language="javascript" src="./js/shBrushDelphi.js" />
        <script language="javascript" src="./js/shBrushJava.js" />
        <script language="javascript" src="./js/shBrushJScript.js" />
        <script language="javascript" src="./js/shBrushPhp.js" />
        <script language="javascript" src="./js/shBrushPython.js" />
        <script language="javascript" src="./js/shBrushRuby.js" />
        <script language="javascript" src="./js/shBrushSql.js" />
        <script language="javascript" src="./js/shBrushVb.js" />
        <script language="javascript" src="./js/shBrushXml.js" />
        <keywords>Eclipse, UML, plugin,reverse engineering</keywords>
        <author>Julien Pastel</author>
    </head>
    <body>
        <div class="chapter">
            <h2>1.Introduction</h2>
            <div class="subChapter">
                <h3>1.1.What is EclipseUML ?</h3>
                <p>
                    EclipseUML of Omondo is, as its name points it out, an Eclipse’s plugin which allow to make UML diagram and code generating/reversing functionalities integrated to your IDE. This plugin is available in two versions:
                    <br />
                    <br />
                    - EclipseUML Free Edition
                    <br />
                    - EclipseUML Studio Edition
                    <br />
                    <br />
                    As part of this article, we’ll use the free edition.
                </p>
            </div>
            <div class="subChapter">
                <h3>1.2. EclipseUML download and installation</h3>
                <h4>1.2.1. Download</h4>
                <p>
                   First of all, we have to download the plugin. We can find it at the following address:
                    <br />
                    <br />
                    <a href="http://www.eclipsedownload.com/download/free/eclipse_3x/index.html" target="_blank">
                        <img src="./images/EclipseUML_html_m26b8a3a7.jpg" />
                    </a>
                </p>
                <h4>1.2.2.Installation</h4>
                <p>
                    Once the plugin downloaded (a jar file), you just have to double-click to launch it automatically or launch it with command lines:
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_44a4bfa8.jpg" />
                    <br />
                    You should have the following screen :
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m28308a03.jpg" />
                    <br />
                    When the software will ask you in which folder you want to install EclipseUML, you have to choose the root directory of your Eclipse, otherwise the plugin won’t be considered. You can, like the example, select the folder C:\eclipse\ :
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m63096e12.jpg" />
                    <br />
                    <br />
                    In the next screen, let all checked as default, these are indispensable plugins to ensure the smooth functioning of EclipseUML. Then, the installer will purpose to install all plugins needed if those had been selected, if you add EclipseUML to an Eclipse that already have those plugins, you can deselect them.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m2bdbff1b.jpg" />
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_10399bae.jpg" />
                    <br />
                    <br />
                    Now that the installation is over, we can proceed to the practical case.
                </p>
            </div>
        </div>
        <div class="chapter">
            <h2>2. Implementation</h2>
            <p>In this part, we’ll study the implementation of a simple class diagram and the reverse engineering functionality too, which allow creating UML diagrams from existing classes.</p>
            <div class="subChapter">
                <h3>2.1. Class diagrams</h3>
                <h4>2.1.1. Project creation</h4>
                <p>
                    First of all, before creating a class diagram, we’ll create a new project in Eclipse.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_7e963a03.jpg" />
                    <br />
                    <br />
                    In this presentation, we’ll name the project « umltest », but you’re free to name it differently.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m1f06b09e.jpg" />
                    <br />
                    <br />
                    Now that the project is created, we create a package.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m80a1320.jpg" />
                    <br />
                    <br />
                    In this example, we’ll name this package « demo ».
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_663a748d.jpg" />
                </p>
                <h4>2.1.2. Creation of the class diagram</h4>
                <p>
                    Now that the project is created, we can create the first class diagram. We’ll be able, thanks to this diagram, to generate automatically classes code. We’ll create it in the “demo” package. To do that, we right-click on the package and we choose to create a new UML class diagram. As you can see, thanks to EclipseUML, you can create all kind of possible UML diagram (Use Case, Sequence,…). In the part of this tutorial, we’ll just see Class diagrams.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_66173653.jpg" />
                    <br />
                    <br />
                    In the window that you get, you can specify the diagram’s name and to define some options:
                    <br />
                    <br />
                    - Association: print different associations between classes of the diagram.
                    <br />
                    - Inheritance: print inheritance links.
                    <br />
                    - Dependency: print importation links between classes.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_d1cd2e1.jpg" />
                    <br />
                    <br />
                    In this example, we name the diagram « demo » and place it into the « demo » package. Once done, the EclipseUML environment load itself and you‘ll be able to create yours classes, interfaces, different links between classes (association, inheritance, dependency …)
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_2692fa95.jpg" />
                </p>
                <h4>2.1.3. Class creation</h4>
                <p>
                    Now that we have our project and our class diagram created, we’ll see how to create a class via the EclipseUML environment. First of all you’ve two possibilities:
                    <br />
                    <br />
                    - Go through the tool bar.
                    <br />
                    - Right click and New… Class
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m6ff92f0.jpg" />
                    <br />
                    <br />
                    Then you have the Eclipse default class creation window.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_7011a644.jpg" />
                    <br />
                    <br />
                    Once your class created, you can see that not only your class diagram contains the class, but that you can modify directly the class code as well.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_47832ac1.jpg" />
                    <br />
                    <br />
                    Now, you can add to this class:
                    <br />
                    <br />
                    - Attributes
                    <br />
                    - Methods
                    <br />
                    - Internal classes
                    <br />
                    - Internal interfaces
                    <br />
                    <br />
                    To do that, right-click on the created class and choose what interested you.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_3cd49e46.jpg" />
                    <br />
                    <br />
                    First, we’ll add a private attribute “name” type String having accessors (getName() and setName()). In the printed window, you can find all require options for the attribute definition. It’s possible to choose the visibility of your attribute, mutators, and if you wish to use or not accessors (get and set where the method is « read only ») and visibility indicators.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_3789074c.jpg" />
                    <br />
                    <br />
                    <u>Reminder</u>
                    : An accessor is a public method which allow you to access a private variable of an instance.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m3a5a1aed.jpg" />
                    <br />
                    <br />
                    IHere, in the UML class definition, we won’t see directly accessors. Indeed, by default, the EclipseUML environment use the property concept (a public property match a private attribute and corresponding accessor(s)). Nevertheless, if you wish to have the detail of your class, you can disable this functionality thanks to preferences of your class via a right-click and Preferences.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_43e49355.jpg" />
                    <br />
                    <br />
                    You have the possibility to change visibility options in your diagram concerning yours different attributes and methods. It’s you to see what is interesting for you. By the same way, you can add methods and constructors as easily as for the attributes.
                </p>
                <p />
            </div>
            <div class="subChapter">
                <h3>2.2. Reverse Engineering</h3>
                <p>
                    Thanks to this plugin, you the possibility to create UML diagrams from an existing project, package by package.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m36b31eaa.jpg" />
                    <br />
                    <br />
                    In order to proceed to the reverse-engineering of our existing project, we right-click on the project, then UML and Reverse engineering. If you already have UML annotations in your project, you can delete it via the “Clean” function for more clearness in your project but even if you don’t need UML comment in your JavaDoc.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_7b4d1277.jpg" />
                    <br />
                    <br />
                    In the printed window, you check your project and don’t care about warnings. You can now proceed to the reverse-engineering of the project.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_166b6c81.jpg" />
                    <br />
                    <br />
                    Now, you get a diagram representing different packages of your project. To obtain classes, double-click on the package.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m7ffa0d32.jpg" />
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m1ca5f66d.jpg" />
                    <br />
                    <br />
                    In this window, you choose link and wished scope options.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_58493c9c.jpg" />
                    <br />
                    <br />
                    Then, it will ask you to choose classes you want to include in the diagram. Finally, you’ll get the class diagram. In this example, EclipseUML has created automatically links between the two classes: a dependency (importation of the Animal class) and an association. Indeed, here the zoo class contain an Animal ArrayList.
                    <br />
                    <br />
                    <img src="./images/EclipseUML_html_m49cb7ce.jpg" />
                </p>
                <p />
            </div>
        </div>
    </body>
</html>

